<form class="form-horizontal form-validate form-modal" method="post" action="{:url('info')}">
  <div class="modal-dialog" style="width: 700px;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">{$row['id'] > 0?'编辑任务':'添加任务'}</h4>
      </div>
      <div class="modal-body">
        <div class="form-group">
          <label class="control-label">任务标题：</label>
          <div class="col-sm-6">
            <input type="text" class="input-xlarge" data-rule-maxlength="20" data-rule-required="true" name="title" value="{$row.title}" >
          </div>
        </div>
        <div class="form-group">
          <label class="control-label">任务图标：</label>
          <div class="col-sm-6 ">
<!--            <input type="text" class="input-xlarge" data-rule-maxlength="20"  name="img" value="{$row.img}" >-->
            <div class="controls col-sm-3">
              <div class="defUpImgBox"  data-toggle="uploaderImg" style="width: 130px; height: 130px">
                <img  src="{$row.img|default='__STATIC__/main/img/image.png'}">
                <input type="hidden"  name="img"  value="{$row.img}">
                <div class="tips">点击上传</div>
              </div>
<!--              <span class="help-inline">(建议尺寸：同上面商品图片大小一致)</span>-->
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label">任务描述：</label>
          <div class="col-sm-6">
            <input type="text" class="input-xlarge"  data-rule-required="true" name="content" value="{$row.content}" >
          </div>
        </div>
        <div class="form-group">
          <label class="control-label">任务积分：</label>
          <div class="col-sm-6">
            <input type="text" class="input-xlarge" data-rule-number="20" data-rule-required="true" name="points" value="{$row.points}" >
          </div>
        </div>
        <div class="form-group">
          <label class="control-label">任务类型：</label>
          <div class="col-sm-6">
            <label class="radio-inline">
              <input name="type" value="1" onclick="nums_nums(1)" {$row['type']==1?'checked':'checked'} class="js_undertake " type="radio" >
              每天单次
            </label>
            <label class="radio-inline">
              <input name="type" value="2" onclick="nums_nums(2)" {$row['type']==2?'checked':''}  class="js_undertake " type="radio" >
              每天多次
            </label>
            <label class="radio-inline">
              <input name="type" value="3" onclick="nums_nums(3)" {$row['type']==3?'checked':''} class="js_undertake " type="radio" >
              每天无限制
            </label>
            <input type="text"  class="input-sm" {$row['type']!=2?'style="display:none"':''} placeholder="输入次数" data-rule-number="true" name="task_nums" value="{$row['type']==2?$row.task_nums:''}">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label">状态：</label>
          <div class="col-sm-6">
            <label class="radio-inline">
              <input name="status" value="1" {$row['status']==1?'checked':''} class="js_undertake " type="radio" >
              上架
            </label>
            <label class="radio-inline">
              <input name="status" value="0" {$row['status']==0?'checked':''} class="js_undertake " type="radio" >
              下架
            </label>
          </div>
        </div>
        <input type="hidden" name="id" value="{$row.id}">
        <div class="form-group">
          <label class="control-label">排序：</label>
          <div class="col-sm-6 ">
            <input type="text" class="input-xlarge" data-rule-maxlength="10"  name="sort" value="{$row.sort}" >
          </div>
        </div>

      </div>
      <div class="modal-footer">
        <input  type="hidden" name="id" value="{$row.id|intval}"/>
        <button type="submit" class="btn btn-primary" data-loading-text="保存中..." disabled>保存</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
      </div>
    </div>
  </div>
</form>
<script>
  function nums_nums(type) {
    if (type==2) {
      $("input[name='task_nums']").show();
    } else {
      $("input[name='task_nums']").hide();
    }
  }
</script>